﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ExpressionTreeLib;
using Expression = System.Linq.Expressions.Expression;

namespace EditorExe
{
    /// <summary>
    /// Interaction logic for NewExpressionNodeDialog.xaml
    /// </summary>
    public partial class NewExpressionNodeDialog : Window
    {
        public NewExpressionNodeDialog()
        {
            InitializeComponent();
            this.listView1.ItemsSource = from t in ExpressionNodeTypeMapping.Mapping.Keys
                                         select t;
            this.listView1.DisplayMemberPath = "Name";
        }

        private void HandleDoubleClick(object sender, MouseButtonEventArgs e)
        {
            this.Selected = this.listView1.SelectedValue as Type;
            this.DialogResult = true;
        }

        public Type Selected { get; private set; }
    }
}
